XOBJ = .o
XEXE =
XLIB = .a
XLIB_I = 
XDLL = .so
XDLL_I = 

COUT = -o
LOUT = -o
DLLOUT = -o
CUOUT = -o=
AROUT = -cq

ifeq (${TARGET_ARCH},32)
	CUDA_LIB = ${CUDA_DIR}/lib
else
	CUDA_LIB = ${CUDA_DIR}/lib64
endif
CUDA_PATH = ${CUDA_DIR}/include

MKL_VERSION = 10.3.1.107
ifeq (${USE_MKL},yes)
	MKL_DIR = /usr/global/intel/mkl/${MKL_VERSION}/mkl
	ifeq (${TARGET_ARCH},64)
		MKL_LIB = ${MKL_DIR}/lib/intel64
	else
		MKL_LIB = ${MKL_DIR}/lib/ia32
	endif
	MKL_PATH = ${MKL_DIR}/include
endif

ifeq (${LOCATION},Cyberstar)
	MPI_VERSION = 1.4.2
else
	MPI_VERSION = 1.4.3
endif

CC = g++ 
LINK = g++
NVCC = ${CUDA_DIR}/bin/nvcc${XEXE}
AR = ar

ifeq (${TARGET_ARCH},32)
	CFLAGS += -m32
	LFLAGS += -m32
	CUFLAGS += -m32
endif
ifeq (${TARGET_ARCH},64)
	CFLAGS += -m64
	LFLAGS += -m64
	CUFLAGS += -m64
endif

ifeq (${debug},no)
	OP_F = -O2
	DB_F = 
else
	OP_F = 
	DB_F = -g
endif

#ifeq (${PROJECT_TYPE},DLL)#Test not working for some reason
	PI_F = -fPIC
#else
#	PI_F = 
#endif

CFLAGS += -c -xc++ ${DB_F} ${OP_F} ${PI_F} ${GCC_CONFIG} $(addprefix -I",$(addsuffix ",${INCLUDE_PATHS})) $(addprefix -D",$(addsuffix ",${DEFINES}))
LFLAGS += ${DB_F} ${LIBS}
CUFLAGS += -c ${DB_F} -arch compute_20 -Xcompiler $(addprefix -I",$(addsuffix ",${INCLUDE_PATHS})) $(addprefix -D",$(addsuffix ",${DEFINES}))
#DLLFLAGS += -shared ${LFLAGS}
DLLFLAGS += ${LFLAGS} -shared -Wl,-soname=
#-shared -Wl,-soname=xattr.so -o "libxattr"
